<template>
	<view class="container">
		<view class="titlebox">智慧水文</view>

		<u-sticky offsetTop="0" customNavHeight="0" bgColor="#1a1a2e">
			<view class="setting-address">
				<view class="address-off" @click="tobelFn" v-if="lanname == ''">
					连接设备
				</view>
				<view class="address-item" @click="lampRFn" v-if="lanname != ''">
					断开连接
				</view>
				<view class="address-item" @click="inquireAbout">
					查询地址
				</view>
				<view class="address-item" @click="obtainData">
					获取数据
				</view>
			</view>
<!-- 			<view class="modify-the" @click="testHex">
				测试数据
			</view>
			<view class="modify-the" @click="modifyTheContent">
				修改数据
			</view> -->
		</u-sticky>
		<view class="settings-list">
			<view class="setting-ess">
				<text class="label">终端地址</text>
				<view class="input-box">
					<input type="digit" v-model="formData.terminalAddress" placeholder="当前地址" />
					<text class="unit" @click="modihexFn">修改</text>
				</view>
			</view>
			<!-- 输入框示例 -->
			<uni-popup ref="inputDialog" type="dialog">
				<uni-popup-dialog ref="inputClose" mode="input" confirmText="修改" cancelText="取消" title="输入修改地址"
					:value="dialogvalue" placeholder="地址范围 0-254" @confirm="dialogInputConfirm"></uni-popup-dialog>
			</uni-popup>
			<view class="setting-item">
				<text class="label">测站编号</text>
				<view class="input-box">
					<input type="digit" v-model="formData.stationCode" placeholder="仅支持数字类型" />
					<text class="unit">编号</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">测站经度</text>
				<view class="input-box">
					<input type="digit" v-model="formData.longitude" placeholder="小数点后6位" />
					<text class="unit">度</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">测站纬度</text>
				<view class="input-box">
					<input type="digit" v-model="formData.latitude" placeholder="小数点后6位" />
					<text class="unit">度</text>
				</view>
			</view>
			<view class="modify-lat" @click="obtainTheLonLat">
				获取经纬度
			</view>
			<view class="setting-item">
				<text class="label">静激光水位修正值</text>
				<view class="input-box">
					<input type="digit" v-model="formData.staticLaserWaterLevelCorrection" placeholder="输入范围 -3.0 ~ 3.0" />
					<text class="unit">米</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">动激光水位修正值</text>
				<view class="input-box">
					<input type="digit" v-model="formData.dynamicLaserWaterLevelCorrection" placeholder="输入范围 -3.0 ~ 3.0" />
					<text class="unit">米</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">静压力水位修正值</text>
				<view class="input-box">
					<input type="digit" v-model="formData.staticPressureWaterLevelCorrection"
						placeholder="输入范围 -3.0 ~ 3.0" />
					<text class="unit">米</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">动压力水位修正值</text>
				<view class="input-box">
					<input type="digit" v-model="formData.dynamicPressureWaterLevelCorrection"
						placeholder="输入范围 -3.0 ~ 3.0" />
					<text class="unit">米</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">静激光毕托管长</text>
				<view class="input-box">
					<input type="digit" v-model="formData.staticLaserPitotLength" placeholder="输入范围 1.0 ~ 6.0" />
					<text class="unit">米</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">动激光毕托管长</text>
				<view class="input-box">
					<input type="digit" v-model="formData.dynamicLaserPitotLength" placeholder="输入范围 1.0 ~ 6.0" />
					<text class="unit">米</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">静压力毕托管长</text>
				<view class="input-box">
					<input type="digit" v-model="formData.staticPressurePitotLength" placeholder="输入范围 1.0 ~ 6.0" />
					<text class="unit">米</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">动压力毕托管长</text>
				<view class="input-box">
					<input type="digit" v-model="formData.dynamicPressurePitotLength" placeholder="输入范围 1.0 ~ 6.0" />
					<text class="unit">米</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">左右安装选择</text>
				<template>
					<view class="labeltext">
						<uni-data-select v-model="formData.installationSide" :clear="false"
							:localdata="leftAange"></uni-data-select>
					</view>
				</template>
			</view>
			<view class="setting-item">
				<text class="label">水位传感器选择</text>
				<template>
					<view class="labeltext">
						<uni-data-select v-model="formData.waterLevelSensor" :clear="false"
							:localdata="sensorAange"></uni-data-select>
					</view>
				</template>
			</view>
			<view class="setting-item">
				<text class="label">安装高度</text>
				<view class="input-box">
					<input type="digit" v-model="formData.installationHeight" placeholder="输入范围 0 ~ 6.0" />
					<text class="unit">米</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">断面梯形高度</text>
				<view class="input-box">
					<input type="digit" v-model="formData.trapezoidHeight" placeholder="输入范围 0.5 ~ 10.0" />
					<text class="unit">米</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">浮球半径</text>
				<view class="input-box">
					<input type="digit" v-model="formData.floatRadius" placeholder="输入范围 0.01 ~ 0.1" />
					<text class="unit">米</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">样本数量</text>
				<view class="input-box">
					<input type="digit" v-model="formData.sampleCount" placeholder="输入范围 5 ~ 100" />
					<text class="unit">个</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">云数据上报间隔</text>
				<view class="input-box">
					<input type="digit" v-model="formData.cloudDataInterval" placeholder="输入范围 3 ~ 3600" />
					<text class="unit">秒</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">电量低上报周期</text>
				<view class="input-box">
					<input type="digit" v-model="formData.lowBatteryReportCycle" placeholder="输入范围 60 ~ 1800" />
					<text class="unit">秒</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">流速系数</text>
				<view class="input-box">
					<input type="digit" v-model="formData.flowVelocityCoefficient" placeholder="输入范围 0.5 ~ 2.0" />
					<text class="unit"></text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">流量系数</text>
				<view class="input-box">
					<input type="digit" v-model="formData.flowCoefficient" placeholder="输入范围 0.5 ~ 2.0" />
					<text class="unit"></text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">左坡角度</text>
				<view class="input-box">
					<input type="digit" v-model="formData.leftSlopeAngle" placeholder="输入范围 30 ~ 90" />
					<text class="unit">度</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">右坡角度</text>
				<view class="input-box">
					<input type="digit" v-model="formData.rightSlopeAngle" placeholder="输入范围 30 ~ 90" />
					<text class="unit">度</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">水量累计积分周期</text>
				<view class="input-box">
					<input type="digit" v-model="formData.waterIntegrationCycle" placeholder="输入范围 5 ~ 240" />
					<text class="unit">秒</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">电量低告警门限</text>
				<view class="input-box">
					<input type="digit" v-model="formData.lowBatteryThreshold" placeholder="输入范围 25 ~ 35" />
					<text class="unit">%</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">稳定值</text>
				<view class="input-box">
					<input type="digit" v-model="formData.stabilityValue" placeholder="输入范围 0.01 ~ 0.9" />
					<text class="unit">米/秒</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">样本采样周期</text>
				<view class="input-box">
					<input type="digit" v-model="formData.sampleCycle" placeholder="输入范围 1 ~ 100" />
					<text class="unit">秒</text>
				</view>
			</view>
			<view class="setting-item">
				<text class="label">渠底宽度</text>
				<view class="input-box">
					<input type="digit" v-model="formData.channelWidth" placeholder="输入范围 0.5 ~ 50" />
					<text class="unit">米</text>
				</view>
			</view>
			<view class="modify-the" @click="modifyTheContent">
				修改数据
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				lanname: '', //蓝牙
				deviceId: '', //蓝牙
				serviceId: '', //蓝牙
				characteristicId: '', //蓝牙
				fff: '', //蓝牙
				formData: {
					terminalAddress: '', //终端地址
					stationCode: '', //测站编号
					longitude: '', //测站经度
					latitude: '', //测站纬度
					staticLaserWaterLevelCorrection: '', //静激光水位修正值
					dynamicLaserWaterLevelCorrection: '', //动激光水位修正值
					staticPressureWaterLevelCorrection: '', //静压力水位修正值
					dynamicPressureWaterLevelCorrection: '', //动压力水位修正值
					staticLaserPitotLength: '', //静激光毕托管长
					dynamicLaserPitotLength: '', //动激光毕托管长
					staticPressurePitotLength: '', //静压力毕托管长
					dynamicPressurePitotLength: '', //动压力毕托管长
					installationSide: '', //左右安装选择
					waterLevelSensor: '', //水位传感器选择
					installationHeight: 0, //安装高度
					trapezoidHeight: '', //断面梯形高度
					floatRadius: '', //浮球半径
					sampleCount: '', //样本数量
					cloudDataInterval: '', //云数据上报间隔
					lowBatteryReportCycle: '', //电量低上报周期
					flowVelocityCoefficient: '', //流速系数
					flowCoefficient: '', //流量系数
					leftSlopeAngle: '', //左坡角度
					rightSlopeAngle: '', //右坡角度
					waterIntegrationCycle: '', //水量累计积分周期
					lowBatteryThreshold: '', //电量低告警门限
					stabilityValue: '', //稳定值
					sampleCycle: '', //样本采样周期
					channelWidth: '' //渠底宽度
				},
				leftAange: [{
						value: 0,
						text: "左安装"
					},
					{
						value: 1,
						text: "右安装"
					},
				], // 左右安装
				sensorAange: [{
						value: 0,
						text: "双激光"
					},
					{
						value: 1,
						text: "双压力"
					},
					{
						value: 2,
						text: "动压力+静激光"
					},
				], // 左右安装
				dialogvalue: '', //
			}
		},
		onShow() {
			console.log('onShow');
			this.lanname = this.vuex_devicename
			this.deviceId = this.vuex_deviceId
			this.getBLEDeviceServices()
			uni.showLoading({
				mask: true,
				title: '连接设备中...'
			});
			setTimeout(() => {
				uni.hideLoading()
			}, 300)
			// 断开设备
			uni.onBLEConnectionStateChange((res) => {
				// 该方法回调中可以用于处理连接意外断开等异常情况
				if (res.connected !== true) {
					console.log('意外断开');
					this.lanname = ''
					uni.$u.vuex('vuex_devicename', '')
					uni.$u.vuex('vuex_deviceId', '')
				}
			})
		},
		methods: {
			// 修改内容
			modifyTheContent() {
				if(!(uni.$u.test.digits(this.formData.stationCode))){
					uni.showToast({
						title: '编号错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.staticLaserWaterLevelCorrection<-3 || this.formData.staticLaserWaterLevelCorrection>3){
					uni.showToast({
						title: '静激光值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.dynamicLaserWaterLevelCorrection<-3 || this.formData.dynamicLaserWaterLevelCorrection>3){
					uni.showToast({
						title: '动激光值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.staticPressureWaterLevelCorrection<-3 || this.formData.staticPressureWaterLevelCorrection>3){
					uni.showToast({
						title: '静压力值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.dynamicPressureWaterLevelCorrection<-3 || this.formData.dynamicPressureWaterLevelCorrection>3){
					uni.showToast({
						title: '动压力值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.staticLaserPitotLength<1 || this.formData.staticLaserPitotLength>6){
					uni.showToast({
						title: '静激管长值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.dynamicLaserPitotLength<1 || this.formData.dynamicLaserPitotLength>6){
					uni.showToast({
						title: '动激管长值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.staticPressurePitotLength<1 || this.formData.staticPressurePitotLength>6){
					uni.showToast({
						title: '静压管长值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.dynamicPressurePitotLength<1 || this.formData.dynamicPressurePitotLength>6){
					uni.showToast({
						title: '动压管长值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.installationSide === ''){
					uni.showToast({
						title: '安装方向未选择',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.waterLevelSensor === ''){
					uni.showToast({
						title: '水位传感未选择',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.installationHeight<0 || this.formData.installationHeight>6){
					uni.showToast({
						title: '安装高度错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.trapezoidHeight<0.5 || this.formData.trapezoidHeight>10){
					uni.showToast({
						title: '断面梯形值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.floatRadius<0.01 || this.formData.floatRadius>0.1){
					uni.showToast({
						title: '浮球半径值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.sampleCount<5 || this.formData.sampleCount>100){
					uni.showToast({
						title: '样本数量值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.cloudDataInterval<3 || this.formData.cloudDataInterval>3600){
					uni.showToast({
						title: '云上报间隔值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.lowBatteryReportCycle<60 || this.formData.lowBatteryReportCycle>1800){
					uni.showToast({
						title: '电量周期错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.flowVelocityCoefficient<0.5 || this.formData.flowVelocityCoefficient>2){
					uni.showToast({
						title: '流速系数值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.flowCoefficient<0.5 || this.formData.flowCoefficient>2){
					uni.showToast({
						title: '流量系数值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.leftSlopeAngle<30 || this.formData.leftSlopeAngle>90){
					uni.showToast({
						title: '左坡角度值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.rightSlopeAngle<30 || this.formData.rightSlopeAngle>90){
					uni.showToast({
						title: '右坡角度值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.waterIntegrationCycle<5 || this.formData.waterIntegrationCycle>240){
					uni.showToast({
						title: '水量周期错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.lowBatteryThreshold<25 || this.formData.lowBatteryThreshold>35){
					uni.showToast({
						title: '电量低限制错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.stabilityValue<0.01 || this.formData.stabilityValue>0.9){
					uni.showToast({
						title: '稳定值错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.sampleCycle<1 || this.formData.sampleCycle>100){
					uni.showToast({
						title: '采样周期错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				if(this.formData.channelWidth<0.5 || this.formData.channelWidth>50){
					uni.showToast({
						title: '渠底宽度错误',
						icon: 'error',
						duration: 1200,
						mask: true
					});
					return
				}
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				setTimeout(() => {
					uni.hideLoading();
				}, 4000);
				// 地址
				let dizhi = this.decimalToHex(this.formData.terminalAddress) + '103000002448'
				// 编号
				let bianhao = this.strRepair(this.decimalToHex(this.formData.stationCode), 8)
				//经度
				let lon = this.strRepair(this.decimalToHex(this.formData.longitude * 1000000), 8)
				//纬度
				let lat = this.strRepair(this.decimalToHex(this.formData.latitude * 1000000), 8)
				// 静激光水位修正值
				let jjz = this.strRepair(this.decimalToHex((this.formData.staticLaserWaterLevelCorrection * 1 + 3) * 1000),
					4)
				// 动激光水位修正值
				let djz = this.strRepair(this.decimalToHex((this.formData.dynamicLaserWaterLevelCorrection * 1 + 3) *
					1000), 4)
				// 静压力水位修正值
				let jyz = this.strRepair(this.decimalToHex((this.formData.staticPressureWaterLevelCorrection * 1 + 3) *
					1000), 4)
				// 动压力水位修正值
				let dyz = this.strRepair(this.decimalToHex((this.formData.dynamicPressureWaterLevelCorrection * 1 + 3) *
					1000), 4)
				// 静激光毕托管长
				let jjc = this.strRepair(this.decimalToHex(this.formData.staticLaserPitotLength * 1000), 4)
				// 动激光毕托管长
				let djc = this.strRepair(this.decimalToHex(this.formData.dynamicLaserPitotLength * 1000), 4)
				// 静压力毕托管长
				let jyc = this.strRepair(this.decimalToHex(this.formData.staticPressurePitotLength * 1000), 4)
				// 动压力毕托管长
				let dyc = this.strRepair(this.decimalToHex(this.formData.dynamicPressurePitotLength * 1000), 4)
				// 左右安装
				let zyaz = ''
				if (this.formData.installationSide == '0') {
					zyaz = '4C'
				}
				if (this.formData.installationSide == '1') {
					zyaz = '52'
				}
				// 水位传感器选择
				let cgqx = ''
				if (this.formData.waterLevelSensor == '0') {
					cgqx = '4A'
				}
				if (this.formData.waterLevelSensor == '1') {
					cgqx = '50'
				}
				if (this.formData.waterLevelSensor == '2') {
					cgqx = '4D'
				}
				// 安装高度
				let anzh = this.strRepair(this.decimalToHex(this.formData.installationHeight * 1000), 4)
				// 断面梯形高度
				let txh = this.strRepair(this.decimalToHex(this.formData.trapezoidHeight * 1000), 4)
				// 浮球半径
				let fqbj = this.strRepair(this.decimalToHex(this.formData.floatRadius * 1000), 2)
				// 样本数量
				let ybsl = this.strRepair(this.decimalToHex(this.formData.sampleCount), 2)
				// 云数据上报间隔
				let ysb = this.strRepair(this.decimalToHex(this.formData.cloudDataInterval), 4)
				// 电量低上报周期
				let dld = this.strRepair(this.decimalToHex(this.formData.lowBatteryReportCycle), 4)
				// 流速系数
				let lsx = this.strRepair(this.decimalToHex(this.formData.flowVelocityCoefficient * 10000), 4)
				// 流量系数
				let llx = this.strRepair(this.decimalToHex(this.formData.flowCoefficient * 10000), 4)
				// 左坡角度
				let ljd = this.strRepair(this.decimalToHex(this.formData.leftSlopeAngle * 1000000), 4)
				// 右坡角度
				let rjd = this.strRepair(this.decimalToHex(this.formData.rightSlopeAngle * 1000000), 4)
				// 预留
				let ylsj = '0000000000000000'
				// 水量累计积分周期
				let sljl = this.strRepair(this.decimalToHex(this.formData.waterIntegrationCycle), 2)
				// 电量低告警门限
				let dldjg = this.strRepair(this.decimalToHex(this.formData.lowBatteryThreshold), 2)
				// 稳定值
				let wdz = this.strRepair(this.decimalToHex(this.formData.stabilityValue * 1000), 4)
				// 预留
				let yull = '0000000000'
				//样本采样周期
				let cyzq = this.strRepair(this.decimalToHex(this.formData.sampleCycle), 2)
				//渠底宽度
				let qdkd = this.strRepair(this.decimalToHex(this.formData.channelWidth * 1000), 2)
				// 全部
				let arrHex = dizhi + bianhao + lon + lat + jjz + djz + jyz + dyz + jjc + djc + jyc + dyc + zyaz + cgqx +
					anzh + txh + fqbj + ybsl + ysb + dld + lsx + llx + ljd + rjd + ylsj + sljl + dldjg + wdz + yull +
					cyzq + qdkd
				let gethexarr = this.buildHexWithCRC(arrHex)
				// 给蓝牙传输
				this.conbuffer(gethexarr)
				console.log('修改', gethexarr.length, gethexarr);
			},
			// 内容限制
			// 修改地址
			modihexFn() {
				console.log(this.dialogvalue);
				this.$refs.inputDialog.open()
			},
			dialogInputConfirm(val) {
				this.dialogvalue = val
				// 关闭窗口后，恢复默认内容
				this.$refs.inputDialog.close()
				if (!(uni.$u.test.digits(this.dialogvalue))) {
					uni.showToast({
						title: '输入错误',
						icon: 'error',
						duration: 2000,
						mask: true
					});
					return
				}
				if (this.dialogvalue < 1 || this.dialogvalue > 255) {
					uni.showToast({
						title: '超出范围',
						icon: 'error',
						duration: 2000,
						mask: true
					});
					return
				}
				let hex = this.decimalToHex(this.formData.terminalAddress) + '06FF0200' + this.decimalToHex(this
					.dialogvalue)
				let controlWordBit = this.buildHexWithCRC(hex)
				console.log('HEX数组', controlWordBit);
				// 给蓝牙传输
				this.conbuffer(controlWordBit)
			},
			// 获取数据
			obtainData() {
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				setTimeout(() => {
					uni.hideLoading();
				}, 3000);
				let hex = this.decimalToHex(this.formData.terminalAddress) + '0330000024'
				let controlWordBit = this.buildHexWithCRC(hex)
				console.log('HEX数组', controlWordBit);
				// 给蓝牙传输
				this.conbuffer(controlWordBit)
			},
			// 询问地址
			inquireAbout() {
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				setTimeout(() => {
					uni.hideLoading();
				}, 3000);
				let hex = '0003FF020001140F'
				let controlWordBit = this.hexStringToArray(hex)
				// 给蓝牙传输
				this.conbuffer(controlWordBit)
			},
			// 获取数据------------------------------
			monitoringInformationProcessing(res) {
				console.log('监听数据', res, res.length);
				if (res.substr(0, 4) == '0003') {
					//终端地址
					this.formData.terminalAddress = this.hexToDecimal(res.substr(8, 2))
				}
				if (res.substr(2, 4) == '0348') {
					// 测站编号
					this.formData.stationCode = this.hexToDecimal(res.substr(6, 8))
					// 测站经度
					this.formData.longitude = (this.hexToDecimal(res.substr(14, 8)) / 1000000).toFixed(6)
					// 测站纬度
					this.formData.latitude = (this.hexToDecimal(res.substr(22, 8)) / 1000000).toFixed(6)
					// 水位修正值
					this.formData.staticLaserWaterLevelCorrection = this.hexToDecimal(res.substr(30, 4)) / 1000 - 3
					this.formData.dynamicLaserWaterLevelCorrection = this.hexToDecimal(res.substr(34, 4)) / 1000 - 3
					this.formData.staticPressureWaterLevelCorrection = this.hexToDecimal(res.substr(38, 4)) / 1000 - 3
					this.formData.dynamicPressureWaterLevelCorrection = this.hexToDecimal(res.substr(42, 4)) / 1000 - 3
					// 毕托管长度
					this.formData.staticLaserPitotLength = this.hexToDecimal(res.substr(46, 4)) / 1000
					this.formData.dynamicLaserPitotLength = this.hexToDecimal(res.substr(50, 4)) / 1000
					this.formData.staticPressurePitotLength = this.hexToDecimal(res.substr(54, 4)) / 1000
					this.formData.dynamicPressurePitotLength = this.hexToDecimal(res.substr(58, 4)) / 1000
					// 左右安装
					let lr = this.hexToString(res.substr(62, 2))
					if (lr == 'L') {
						this.formData.installationSide = 0
					} else {
						this.formData.installationSide = 1
					}
					// 水位传感器选择
					let dj = this.hexToString(res.substr(64, 2))
					if (dj == 'J') {
						this.formData.waterLevelSensor = 0
					} else if (dj == 'P') {
						this.formData.waterLevelSensor = 1
					} else if (dj == 'M') {
						this.formData.waterLevelSensor = 2
					}
					// 安装高度
					this.formData.installationHeight = this.hexToDecimal(res.substr(66, 4)) / 1000
					// 断面梯形高度
					this.formData.trapezoidHeight = this.hexToDecimal(res.substr(70, 4)) / 1000
					// 浮球半径
					this.formData.floatRadius = this.hexToDecimal(res.substr(74, 2)) / 1000
					// 样本数量
					this.formData.sampleCount = this.hexToDecimal(res.substr(76, 2))
					// 云数据上报间隔
					this.formData.cloudDataInterval = this.hexToDecimal(res.substr(78, 4))
					// 电量低上报周期
					this.formData.lowBatteryReportCycle = this.hexToDecimal(res.substr(82, 4))
					// 流速系数
					this.formData.flowVelocityCoefficient = this.hexToDecimal(res.substr(86, 4)) / 10000
					// 流量系数
					this.formData.flowCoefficient = this.hexToDecimal(res.substr(90, 4)) / 10000
					// 左坡角度
					this.formData.leftSlopeAngle = this.hexToDecimal(res.substr(94, 8)) / 1000000
					// 右坡角度
					this.formData.rightSlopeAngle = this.hexToDecimal(res.substr(102, 8)) / 1000000
					// 水量累计积分周期
					this.formData.waterIntegrationCycle = this.hexToDecimal(res.substr(126, 2))
					// 电量低告警门限
					this.formData.lowBatteryThreshold = this.hexToDecimal(res.substr(128, 2))
					// 稳定值
					this.formData.stabilityValue = this.hexToDecimal(res.substr(130, 4)) / 1000
					// 样本采样周期
					this.formData.sampleCycle = this.hexToDecimal(res.substr(144, 2))
					// 渠底宽度
					this.formData.channelWidth = this.hexToDecimal(res.substr(146, 4)) / 1000
				}
				// 修改成功
				if (res.substr(2, 4) == '1030' || res.substr(2, 4) == '06ff') {
					uni.showToast({
						title: '修改成功',
						icon: 'success',
						duration: 2000,
						mask: true
					});
				}
			},
			// 获取经纬度
			obtainTheLonLat() {
				uni.getLocation({
					type: 'wgs84',
					success: (res) => {
						this.formData.longitude = res.longitude.toFixed(6)
						this.formData.latitude = res.latitude.toFixed(6)
						console.log('当前位置的经度：' + res.longitude.toFixed(6));
						console.log('当前位置的纬度：' + res.latitude.toFixed(6));
					}
				});
			},
			// 测试
			testHex() {
				let num1 =
					'00030200014444'
				let num2 =
					'0103480000000106d2607802448e5c0bb80bb80bb80bb807d007d007d007d04c5007d003e8280a000a003c27102710055d4a80055d4a800000000000000000051e006400000000000103e839de'
				this.monitoringInformationProcessing(num1)
				setTimeout(() => {
					this.monitoringInformationProcessing(num2)
				}, 10)
			},
			// 输入蓝牙数据
			conbuffer(data) {
				let msg = data
				console.log('发送数据格式蓝牙', data);
				// 向蓝牙设备发送一个0x00的16进制数据
				const buffer = new ArrayBuffer(msg.length)
				const dataView = new DataView(buffer)
				// dataView.setUint8(0, 0)
				for (var i = 0; i < msg.length; i++) {
					// dataView.setUint8(i, msg.charAt(i).charCodeAt())
					dataView.setUint8(i, msg[i]);
				}
				this.sendMsgToKey(buffer)
			},
			//监听消息变化++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
			listenValueChange(data) {
				setTimeout(() => {
					uni.onBLECharacteristicValueChange(res => {
						let resHex = this.ab2hex(res.value)
						this.monitoringInformationProcessing(resHex)
					})
				}, 300)
			},
			//获取蓝牙的所有服务
			getBLEDeviceServices() {
				setTimeout(() => {
					uni.getBLEDeviceServices({
						// 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
						deviceId: this.vuex_deviceId,
						success: (res) => {
							console.log('获取vuex_deviceId', this.vuex_deviceId);
							console.log('获取蓝牙所有服务', res);
							//E95D93AF-251D-470A-A062-FA1922DFA9A8
							//6E400001-B5A3-F393-E0A9-E50E24DCCA9E
							res.services.forEach((item) => {

								if (item.uuid.indexOf("0000FFF0") != -1) {
									this.serviceId = item.uuid;
									//获取特征
									this.getBLEDeviceCharacteristics()
								}
								if (item.uuid.indexOf("0000FFE0") != -1) {
									this.serviceId = item.uuid;
									//获取特征
									this.getBLEDeviceCharacteristics()
								}
								if (item.uuid.indexOf("00001000") != -1) {
									this.serviceId = item.uuid;
									//获取特征
									this.getBLEDeviceCharacteristics()
								}
							})
						}
					})
				}, 1000)
			},
			//获取蓝牙特征
			getBLEDeviceCharacteristics() {
				console.log('获取蓝牙特征值');
				setTimeout(() => {
					uni.getBLEDeviceCharacteristics({
						// 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
						deviceId: this.deviceId,
						// 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
						serviceId: this.serviceId,
						success: (res) => {
							this.characteristics = res.characteristics
							res.characteristics.forEach((item) => {

								if (item.uuid.indexOf("FFF2") != -1) {
									this.fff = item.uuid
								}
								if (item.uuid.indexOf("FFE1") != -1) {
									this.fff = item.uuid
								}
								if (item.uuid.indexOf("0000FFE1") != -1) {
									this.characteristicId = item.uuid
									//利用传参的形势传给下面的notify，这里的uuid如果都需要用到，就不用做判断了，建议使用setTimeout进行间隔性的调用此方法
									this.notifyBLECharacteristicValueChange(item.uuid)
								}
								if (item.uuid.indexOf("0000FFF1") != -1) {
									this.characteristicId = item.uuid
									this.notifyBLECharacteristicValueChange(item.uuid)
								}
								// EW-DTU02
								if (item.uuid.indexOf("00001001") != -1) {
									this.fff = item.uuid
								}
								if (item.uuid.indexOf("00001002") != -1) {
									this.characteristicId = item.uuid
									this.notifyBLECharacteristicValueChange(item.uuid)
								}
							})
						},
						fail: (res) => {
							console.log(res)
						}
					})
				}, 1000)
			},
			// 删除指定字符串最后面
			removeTrailingSubstring(str, suffix) {
				if (!str || !suffix) return str;

				const strLength = str.length;
				const suffixLength = suffix.length;

				// 检查字符串是否以指定的子串结尾
				if (strLength >= suffixLength &&
					str.substring(strLength - suffixLength) === suffix) {
					return str.substring(0, strLength - suffixLength);
				}

				return str;
			},
			// 将十六进制字符串分割成数组
			hexStringToArray(hexStr) {
				const arr = [];
				for (let i = 0; i < hexStr.length; i += 2) {
					const byte = hexStr.substr(i, 2);
					arr.push(`0x${byte}`);
				}
				return arr;
			},
			// 计算 CRC16 校验码（Modbus 标准）
			calculateCRC16(hexArray) {
				let crc = 0xFFFF; // CRC 初始值
				for (let i = 0; i < hexArray.length; i++) {
					const byte = parseInt(hexArray[i], 16); // 转成十进制
					crc ^= byte;
					for (let j = 0; j < 8; j++) {
						if (crc & 0x0001) {
							crc = (crc >> 1) ^ 0xA001; // Modbus CRC16 多项式
						} else {
							crc >>= 1;
						}
					}
				}
				// 返回 CRC 低字节和高字节（小端序）
				return [
					`0x${(crc & 0xFF).toString(16).padStart(2, '0')}`, // 低字节
					`0x${((crc >> 8) & 0xFF).toString(16).padStart(2, '0')}` // 高字节
				];
			},
			// 组合最终数组（原始数据 + CRC）
			buildHexWithCRC(hexStr) {
				// 1. 分割字符串成数组
				const hexArray = this.hexStringToArray(hexStr);

				// 2. 计算 CRC16
				const crc = this.calculateCRC16(hexArray);

				// 3. 合并原始数据和 CRC
				return [...hexArray, ...crc];
			},
			// 16进制转2进制
			hexToBinaryW(hexString) {
				if (!/^[0-9A-Fa-f]+$/.test(hexString)) {
					throw new Error("Invalid hexadecimal string");
				}
				const decimal = parseInt(hexString, 16);
				return decimal.toString(2);
			},
			// 10进制转32位二进制补码
			NumberOf1(num) {
				// 获取负数的绝对值
				const absoluteValue = Math.abs(num);

				// 将绝对值转换为32位二进制字符串
				let binaryString = absoluteValue.toString(2);

				// 确保二进制字符串长度为32位
				while (binaryString.length < 32) {
					binaryString = '0' + binaryString;
				}

				// 对二进制字符串取反
				const invertedBinaryString = binaryString.split('').map(bit => bit === '0' ? '1' : '0').join('');

				// 将取反后的二进制字符串转换为数字并加1
				const twosComplement = parseInt(invertedBinaryString, 2) + 1;

				// 再次将补码转换为32位二进制字符串
				binaryString = twosComplement.toString(2);
				// 确保二进制字符串长度为32位
				while (binaryString.length < 32) {
					binaryString = '0' + binaryString;
				}

				return binaryString;
			},
			// 二进制补码转16进制
			binaryToHex(binaryStr) {
				// 确保二进制字符串是32位
				if (binaryStr.length !== 32) {
					throw new Error('Binary string must be 32 bits long');
				}

				// 将二进制字符串转换为数字
				var number = parseInt(binaryStr, 2);

				// 转换为16进制并返回结果
				return number.toString(16);
				// 示例使用
				// var binaryStr = '010101010101010101010101010101010'; // 32位二进制补码
				// var hexStr = binaryToHex(binaryStr);
			},
			//数组求平均
			averageSum(arr) {
				if (arr.length === 0) {
					return 0; // 当数组为空时，平均值为0
				}

				let sum = 0;
				for (let i = 0; i < arr.length; i++) {
					sum += arr[i];
				}

				return sum / arr.length;
			},
			// 长度不够补0
			strRepair(str, nub) {
				let nubm = nub * 1
				let strif = str + ''
				if (strif.length < nubm) {
					for (let i = 0; i < nubm - str.length; i++) {
						strif = '0' + strif
					}
				}
				return strif
			},
			//给每个数组添加0x
			ocstr(data) {
				let arr = []
				for (let i = 0; i < data.length; i++) {
					data[i] = '0x' + data[i]
				}
				return data
			},
			// 每2个字符串为一个元素数组
			chunkStringByTwo(str) {
				const result = [];
				for (let i = 0; i < str.length; i += 2) {
					result.push(str.slice(i, i + 2));
				}
				return result;
			},
			// 处理ASCLL 30 -00
			ascllFn(data) {
				let str = data + ''
				let arr = this.chunkStringByTwo(str)

				for (let i = 0; i < arr.length; i++) {
					if (arr[i] == '00') {
						arr[i] = '30'
					}
				}
				let arrnew = arr

				let strnre = ''
				for (let i = 0; i < arrnew.length; i++) {
					strnre += arrnew[i]
				}
				return strnre
			},
			// CRC16校验
			crc16(dataHexString) {
				const dataBytes = [];
				for (let i = 0; i < dataHexString.length; i += 2) {
					dataBytes.push(parseInt(dataHexString.substr(i, 2), 16));
				}

				let crc = 0xFFFF;
				const polynomial = 0xA001;

				for (const byte of dataBytes) {
					crc ^= byte;
					for (let i = 0; i < 8; i++) {
						if (crc & 0x0001) {
							crc = ((crc >> 1) ^ polynomial) & 0xFFFF;
						} else {
							crc >>= 1;
						}
					}
				}
				let crcstr = crc.toString(16).toUpperCase();
				if (crcstr.length % 2 == 0) {
					let result = crcstr.match(/.{1,2}/g)
					return result;
				} else {
					let str = '0' + crcstr
					let result = str.match(/.{1,2}/g)
					return result;
				}
			},
			// 16进制转10进制
			hexToDecimal(hex) {
				return parseInt(hex, 16);
			},
			// 10进制转16进制
			decimalToHex(data) {
				let decimal = data * 1
				let hex = decimal.toString(16).toUpperCase();
				3
				if (hex.length % 2 !== 0) {
					return '0' + hex
				} else {
					return hex
				}
				// return decimal.toString(16).toUpperCase();
			},
			// 16进制转字符串 ASCII码
			hexToString(hex) {
				let str = '';
				for (let i = 0; i < hex.length; i += 2) {
					let charCode = parseInt(hex.substr(i, 2), 16);
					str += String.fromCharCode(charCode);
				}
				return str;
			},

			//字符串转16进制
			stringToHex(data) {
				let str = data + ''
				return str.split('').map(function(char) {
					return char.charCodeAt(0).toString(16).padStart(2, '0');
				}).join('');
			},
			// 16进制转汉字
			hexToChinese(hex) {
				var str = '';
				for (var i = 0; i < hex.length / 4; i++) {
					var codePoint = parseInt(hex.substr(i * 4, 4), 16); // 获取每四位的十六进制值并转换成十进制
					str += String.fromCharCode(codePoint); // 根据Unicode编码生成对应的字符
				}
				return str;
			},
			// 汉字转16进制
			convertToHex(str) {
				let result = '';
				for (let i = 0; i < str.length; i++) {
					result += str.charCodeAt(i).toString(16);
				}
				return result;
			},
			// 随机数
			getRandomNumber(min, max) {
				return Math.floor(Math.random() * (max - min + 1)) + min;
			},
			// 删除最小的前面几个数字
			removeSmallestN(arr, n) {
				// 对数组进行升序排序
				const sorted = arr.sort((a, b) => a - b);
				// 删除最前面的n个数字
				sorted.splice(0, n);
				return sorted;
			},
			// 删除最大的后面几个数字
			removeMax(arr, n) {
				// 对数组进行升序排序
				const sorted = arr.sort((a, b) => a - b);
				// 删除最后面的n个数字
				sorted.splice(-n);
				return sorted;
			},
			// ArrayBuffer转16进度字符串示例
			ab2hex(buffer) {
				const hexArr = Array.prototype.map.call(
					new Uint8Array(buffer),
					function(bit) {
						return ('00' + bit.toString(16)).slice(-2)
					}
				)
				return hexArr.join('')
			},
			/* 向设备发送消息(分包发送，单包20字节，递归发送)
			 */
			sendMsgToKey(buffer) {
				var that = this //vue中的this
				const packageSize = 20 //分包大小
				if (buffer.byteLength <= 20) { //如果小于20直接发送，不再继续调用
					uni.writeBLECharacteristicValue({
						// 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取
						deviceId: that.deviceId,
						// 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取
						serviceId: that.serviceId,
						// 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取
						// characteristicId: that.fff, //第二步写入的特征值
						characteristicId: that.fff, //第二步写入的特征值
						// 这里的value是ArrayBuffer类型
						value: buffer,
						writeType: 'write',
						success: (res) => {
							//此时设备已接收到你写入的数据
							console.log('写入11111');

						},
						fail: (err) => {
							console.log('传输失败', err)
							this.lanname = this.vuex_devicename
						},
						complete: function() {}
					})
				} else { //如果大于20发送完成后继续递归调用
					var newData = buffer.slice(20)
					var writeBuffer = buffer.slice(0, 20)
					uni.writeBLECharacteristicValue({
						// 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取
						deviceId: that.deviceId,
						// 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取
						serviceId: that.serviceId,
						// 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取
						characteristicId: that.fff, //第二步写入的特征值
						// 这里的value是ArrayBuffer类型
						value: writeBuffer,
						writeType: 'write',
						success: function(res) {
							console.log('写入22222');
							//写入后继续递归调用发送剩下的数据
							setTimeout(() => {
								that.sendMsgToKey(newData)
							}, 100)
						},
						fail: (err) => {
							this.lanname = this.vuex_devicename
							console.log('传输失败', err)
						},
						complete: function() {}
					})
				}
			},
			// 启用 notify 功能
			notifyBLECharacteristicValueChange(characteristicId) {
				console.log('启用 notify 功能');
				uni.notifyBLECharacteristicValueChange({
					state: true, // 启用 notify 功能
					// 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接
					deviceId: this.deviceId,

					// 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取
					serviceId: this.serviceId,
					// 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取
					characteristicId: this.characteristicId,
					success: (res) => {
						console.log('蓝牙名字', res);
						// vuex
						// uni.$u.vuex('vuex_devicename', this.vuexlist.name)
						uni.hideLoading()
						this.listenValueChange()
						uni.showToast({
							title: '设备已连接',
							mask: true,
							duration: 1000
						});
						setTimeout(() => {
							this.inquireAbout()
						}, 1000)
						console.log('蓝牙服务已开启');
					},
					fail: (res) => {
						uni.hideLoading()
						uni.showToast({
							title: '连接设备失败',
							icon: 'fail',
							mask: true,
							duration: 1000
						});

					}
				})
			},
			// 删除数组
			removeById(arr, id) {
				for (let i = 0; i < arr.length; i++) {
					if (arr[i].id === id) {
						arr.splice(i, 1);
						break;
					}
				}
				return arr;
			},
			// 生Id
			nanoid(size = 21) {
				let id = ''
				let i = size
				while (i--) {
					id += this.urlAlphabet[(Math.random() * 64) | 0]
				}
				return id
			},
			// 蓝牙
			tobelFn() {
				//在起始页面跳转到test.vue页面并传递参数
				uni.navigateTo({
					url: '/pages/index/devBEL'
				});

			},
			//断开连接
			lampRFn() {
				uni.closeBLEConnection({
					deviceId: this.vuex_deviceId,
					success: (res) => {
						uni.showToast({
							title: '设备已断开',
							icon: 'error',
							mask: true,
							duration: 1000
						});
						this.lanname = ''
						uni.$u.vuex('vuex_devicename', '')
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.container {
		min-height: 100vh;
		background: linear-gradient(to bottom, #1a1a2e, #16213e);
		padding: 30rpx;

		.titlebox {
			font-size: 48rpx;
			color: #00ff9d;
			text-align: center;
			margin-top: 30rpx;
			text-shadow: 0 0 10rpx rgba(0, 255, 157, 0.5);
			font-weight: bold;
		}

		.modify-the {
			text-align: center;
			font-size: 40rpx;
			padding: 10rpx;
			margin-bottom: 60rpx;
			border-radius: 10rpx;
			color: #000000;
			border: 2rpx solid rgba(0, 255, 157, 0.3);
			background-color: rgba(0, 255, 157, 1);

			&:active {
				color: rgba(0, 255, 157, 1);
				background-color: rgba(0, 255, 157, 0.3);
			}
		}

		.modify-lat {
			text-align: center;
			font-size: 30rpx;
			padding: 10rpx;
			margin-bottom: 20rpx;
			border-radius: 10rpx;
			color: #000000;
			border: 2rpx solid rgba(57, 252, 255, 0.3);
			background-color: rgba(57, 252, 255, 1.0);

			&:active {
				color: rgba(39, 175, 175, 1.0);
				background-color: rgba(22, 99, 99, 0.3);
			}
		}

		.settings-list {
			margin: 20rpx 0;

			.setting-ess {
				display: flex;
				align-items: center;
				justify-content: space-between;
				background: rgba(255, 255, 255, 0.05);
				border-radius: 20rpx;
				padding: 20rpx;
				margin-bottom: 20rpx;
				// backdrop-filter: blur(10rpx);
				border: 2rpx solid rgba(0, 255, 157, 0.3);

				&:hover {
					background: rgba(255, 255, 255, 0.1);
					border-color: rgba(0, 255, 157, 0.5);
				}

				.label {
					color: #00ff9d;
					font-size: 28rpx;
					width: 250rpx;
					flex-shrink: 0;
				}

				.input-box {
					display: flex;
					align-items: center;
					background: rgba(0, 0, 0, 0.2);
					border-radius: 10rpx;
					padding: 0 20rpx;
					flex: 1;

					input {
						flex: 1;
						height: 70rpx;
						color: #fff;
						font-size: 28rpx;
						background: transparent;
						padding: 0 10rpx;
					}

					.unit {
						padding: 5rpx 10rpx;
						border-radius: 10rpx;
						color: #002113;
						background-color: rgba(0, 255, 157, 0.9);
						font-size: 30rpx;
						flex-shrink: 0;

						&:active {
							background-color: #00aa7f;
						}
					}
				}
			}

			.setting-item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				background: rgba(255, 255, 255, 0.05);
				border-radius: 20rpx;
				padding: 20rpx;
				margin-bottom: 20rpx;
				// backdrop-filter: blur(10rpx);
				border: 2rpx solid rgba(0, 255, 157, 0.3);

				&:hover {
					background: rgba(255, 255, 255, 0.1);
					border-color: rgba(0, 255, 157, 0.5);
				}

				// 下拉
				.labeltext {
					width: 400rpx;
					background-color: #fff;
					color: #00aa7f;
					border-radius: 10rpx;
				}

				.label {
					color: #00ff9d;
					font-size: 28rpx;
					width: 250rpx;
					flex-shrink: 0;
				}

				.input-box {
					display: flex;
					align-items: center;
					background: rgba(0, 0, 0, 0.2);
					border-radius: 10rpx;
					padding: 0 20rpx;
					flex: 1;

					input {
						flex: 1;
						height: 70rpx;
						color: #fff;
						font-size: 28rpx;
						background: transparent;
						padding: 0 10rpx;
					}

					.unit {
						color: #00ff9d;
						font-size: 24rpx;
						margin-left: 10rpx;
						flex-shrink: 0;
					}
				}
			}
		}

		.setting-address {
			padding-top: 50rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.address-off {
				width: 200rpx;
				text-align: center;
				padding: 10rpx;
				margin-bottom: 20rpx;
				border-radius: 10rpx;
				color: rgba(0, 255, 157, 1);
				border: 2rpx solid rgba(0, 255, 157, 0.3);
				background-color: rgba(0, 255, 157, 0.1);

				&:active {
					color: rgba(0, 255, 157, 0.5);
					background-color: rgba(0, 255, 157, 0.3);
				}
			}

			.address-item {
				width: 200rpx;
				text-align: center;
				padding: 10rpx;
				margin-bottom: 20rpx;
				border-radius: 10rpx;
				color: #000000;
				border: 2rpx solid rgba(0, 255, 157, 0.3);
				background-color: rgba(0, 255, 157, 1);

				&:active {
					color: rgba(0, 255, 157, 1);
					background-color: rgba(0, 255, 157, 0.3);
				}
			}

		}
	}
</style>